<?php
/* @var $this StaticPageController */
/* @var $model StaticPage */
/* @var $form CActiveForm */
?>

<style type="text/css">
    .form{
        width:70%;
        margin:auto;
    }
    
    .desc{
        font-size: 2em;
        font-weight: bold;
    }
    
    .success{
        font-size: 1.4em;
        font-weight: bold;
        color: blue;
    }
</style>

<div class="form">

    <div class="desc">
        <?php echo $title ?>
    </div>
    
    <div class="success">
        <?php 
        if(Yii::app()->user->hasFlash('success')){
            echo Yii::app()->user->getFlash('success');
        }
        ?>
    </div>
    
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'static-page-form',
	'enableAjaxValidation'=>false,
)); ?>
	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('style'=>'width:100%')); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
	<div class="row">
            <?php echo $form->labelEx($model, 'content'); ?>
            <?php
            $this->widget('ext.widgets.xheditor.XHeditor', array(
                'model' => $model,
                'modelAttribute' => 'content',
                'config' => array(
                    'id' => 'xheditor_1',
                    'tools' => 'mfull', // mini, simple, mfull, full or from XHeditor::$_tools, tool names are case sensitive
                    'skin' => 'default', // default, nostyle, o2007blue, o2007silver, vista
                    'width' => '100%',
                    'height' => '500px',
                    'loadCSS' => XHtml::cssUrl('editor.css'),
                    'upImgUrl' => $this->createUrl('request/uploadFile'),
                    'upImgExt' => 'jpg,jpeg,gif,png',
                ),
            ));
            ?>
        </div>

	<div class="row">
		<?php echo $form->hiddenField($model,'type'); ?>
	</div>

	

	<div class="row buttons">
		<?php echo CHtml::submitButton(Yii::t('main','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->